package main

import (
	"fmt"
)

func main() {
	var N int
	var Max int = 0
	fmt.Scanf("%d", &N)
	var temp int
	for i := 0; i < N; i++ {
		fmt.Scanf("%d", &temp)
		if Max < temp{
			Max = temp
		}
	}
	fmt.Print(Max)
}